Relaxing Ownership with Immutability

نویسندگان

  • Hannes Mehnert
  • Nicholas Cameron
  • Alex Potanin
چکیده

Multiple ownership [4] introduced a novel approach to managing object ownership information called “owners-as-boxes”. Each object is placed in a “box” or context and the nesting relationship between “boxes” or contexts respects the object accesses that happen during the program’s execution. No restrictions are placed on which objects are allowed to access which other objects, rather the ownership contexts provide a hierarchical, as opposed to a more traditional, flat, view of the program’s memory. As with any ownership system, the objects never point ”into” another context, but can point outwards from the context they are in. We show how introducing object immutability, readonly references, and class immutability allows to safely change ownership contexts the objects belong to without breaking the ownership restrictions imposed by multiple ownership. We describe a type system for a language with ownership contexts and immutability, prove it sound, and state and prove both ownership and immutability guarantees. Thus, we show how immutability greatly benefits ownership-enabled languages.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Towards Unifying Immutability and Ownership

Immutability is a highly requested feature missing from the mainstream object-oriented languages. Boyland [2] argues that immutability cannot be introduced into a language without additional aliasing-prone mechanisms such as ownership (or fractional permissions). Rather than providing support for both of these important features independently [8, 6, 1], we explore the possibility of unifying th...

متن کامل

Flexible Immutability with Frozen Objects

Object immutability is a familiar concept that allows safe sharing of objects. Existing language support for immutability is based on immutable classes. However, class-based approaches are restrictive because programmers can neither make instances of arbitrary classes immutable, nor can they control when an instance becomes immutable. These restrictions prevent many interesting applications whe...

متن کامل

Immutable Objects for a Java-Like Language

We extend a Java-like language with immutability specifications and a static type system for verifying immutability. A class modifier immutable specifies that all class instances are immutable objects. Ownership types specify the depth of object states and enforce encapsulation of representation objects. The type system guarantees that the state of immutable objects does not visibly mutate duri...

متن کامل

UML-based Alias Control

We propose a mechanism for alias control which is based on the Unified Modeling Language (UML). Specifically, we propose use of ownership and immutability constraints on UML associations and verification of these constraints through reverse engineering. These constraints inherently support software design principles, and impose requirements on the implementation that may help prevent serious pr...

متن کامل

Dataflow and Type-based Formulations for Reference Immutability

Reference immutability enforces the property that a reference cannot be used to mutate the referenced object. There are several type-based formulations for reference immutability in the literature. However, we are not aware of a dataflow formulation. In this paper, we present a dataflow formulation for reference immutability using CFL-reachability, as well as a type-based formulation using view...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2010